<nz-card class="list_card" [nzTitle]="cardTitle" [nzExtra]="extraTemplate">
  <nz-table #editionsTable [nzFrontPagination]="false" [nzData]="tableHelper.records" [nzTotal]="tableHelper.totalRecordsCount"
    [(nzPageIndex)]="tableHelper.pageIndex" [(nzPageSize)]="tableHelper.defaultPageSize" (nzPageIndexChange)="searchData()"
    (nzPageSizeChange)="searchData(true)" [nzLoading]="tableHelper.isLoading" nzNoResult="暂无数据">
    <thead>
      <tr>
        <th>版本名称</th>
        <th>创建时间</th>
        <th nzWidth="320px">操作</th>
      </tr>
    </thead>
    <tbody>
      <ng-template ngFor let-data [ngForOf]="editionsTable.data">
        <tr>
          <td>{{data.displayName}}</td>
          <td>{{data.creationTime ? (data.creationTime | date:'yyyy-MM-dd') : '-'}}</td>
          <td class="table_operate">
            <!-- 编辑 -->
            <ng-container *ngIf="isGranted('Pages.Tenants.Edit')">
              <a (click)="editBuildingPlan(data)">
                <i nz-icon [type]="'edit'" theme="fill"></i> 编辑
              </a>
              <nz-divider nzType="vertical"></nz-divider>
            </ng-container>
            <!-- 删除 -->
            <ng-container *ngIf="isGranted('Pages.Tenants.Delete')">
              <nz-popconfirm nzTitle="是否确定删除此项？" nzOkText="确定" nzCancelText="取消" (nzOnConfirm)="deleteConfirm(data.id)">
                <a nz-popconfirm>
                  <i nz-icon [type]="'delete'" theme="fill"></i>
                  删除
                </a>
              </nz-popconfirm>
              <nz-divider nzType="vertical"></nz-divider>
            </ng-container>
          </td>
        </tr>
      </ng-template>
    </tbody>
  </nz-table>
</nz-card>

<ng-template #cardTitle>
  <div class="card_title">
    <i style="margin-right: 10px" nz-icon [type]="'editions'" theme="fill"></i> 版本列表
  </div>
</ng-template>

<ng-template #extraTemplate>
  <div class="tab_operate">
    <a (click)="createBuildingPlan()">添加版本</a>
  </div>
</ng-template>